@import 'styles/settings';
@import 'styles/ui.module';

.esri-search {
  @include backdropBlur();
  width: 100%;
  height: 345px;
  bottom: 55px;
  top: auto;
  position: fixed;
  left: 0;
  padding: 30px 20px;
  display: block;

  @media #{$tablet-portrait} {
    padding: 0;
    display: flex;
    flex-flow: row nowrap;
    justify-content: center;
    align-items: center;
    height: 100vh;
    left: 0;
    position: fixed;
    top: 0;
    width: 100vw;
    z-index: 100000;
  }

  // hides loading bar after location start
  .esri-search--searching::before, .esri-search--searching::after {
    content: none;
  }

  // search button with magnifier icon
  .esri-search__submit-button {
    background-color: transparent;
    border: 0;
    outline: none;
    padding-bottom: 20px;
    height: 50px;

    .esri-icon-search::before {
      content: url('../assets/icons/search.svg');
    }
  }

  // hides esri clean search button
  .esri-search__clear-button {
    display: none;
  }

  .esri-search__container {
    border-bottom: 0.5px solid $white;
    flex: none;
    padding-right: 20px;
    margin: 0 auto 5%;
  }

  // search input
  .esri-input {
    @extend %headline;
    color: $white;
    background-color: transparent;
    outline: none;

    &::placeholder {
      color: $white;
      opacity: 0.5;
    }

    @media #{$tablet-portrait} {
      width: 700px;
      letter-spacing: 1px;
    }
  }

  .esri-menu__header {
    @extend %title;
    text-align: center;
    background-color: $brand-color-secondary;
  }

  .esri-search__sources-button {
    display: none;
  }

  .esri-icon-locate-circled {
    display: none;
  }

  // suggestions list
  .esri-menu.esri-search__suggestions-menu {
    background-color: transparent;
    box-shadow: none;

    li {
      @extend %title;
      color: $brand-color-main;
      border: 0;
      outline: none;
      padding: 10px;

      &:hover, &:focus, &:active {
        background-color: rgba(255,255,255,0.05);
      }
    }

    .esri-search__suggestions-list--current-location li {
      color: rgba($color: #000000, $alpha: 0); // hide original text
      
      &::before {
        content: url('../assets/icons/location.svg');
        position: absolute;
        left: 5px;
      }
      
      &::after {
        content: "locate me";
        @extend %title;
        position: absolute;
        left: 30px;
        color: $white;
      }
    }

    strong {
      color: $white;
    }

    &::-webkit-scrollbar {
      width: 7px;
    }
  
    &::-webkit-scrollbar-thumb {
      height: 100px;
      border-radius: 10px;
      background-color: $white;
    }
  }
}
